<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
%>
<html>
<style>
    .btn.fill {
        background: #34dd87;
        color: #474c6c;
    }
    .btn {
        line-height: 1em;
        font-family: arial, sans-serif;
        font-size: 30px;
        font-weight: bold;
        color: white;
        border: 2px solid transparent;
        margin: 0 10px 10px 0;
        padding: 6px 14px;
        box-sizing: border-box;
        display: inline-block;
        text-align: center;
        vertical-align: middle;
        touch-action: manipulation;
        cursor: pointer;
        width: auto;
        white-space: nowrap;
        -webkit-transition: all 0.3s ease-in-out;
        -moz-transition: all 0.3s ease-in-out;
        -o-transition: all 0.3s ease-in-out;
        transition: all 0.3s ease-in-out;
    }
</style>
<head>
    <title>个人中心-任务管理</title>
</head>
<body>
<c:if test="${sessionScope.userinfo.volunteer eq false}" var="result">
    <span style="color:red">你还不是志愿者，加入志愿者可接受任务。</span>
    <div style="text-align:center;padding-top:100px"><a class="btn fill">加入我们</a></div>
</c:if>
<c:if test="${not result}">
    <table class="table">
        <thead>
        <tr>
            <th width="50">序号</th>
            <th width="150">索引图片</th>
            <th width="200">标题</th>
            <th width="150">状态</th>
            <th width="150">完成时间</th>
            <th width="100">操作</th>
        </tr>
        </thead>


        <c:forEach items="${requestScope.pageInfo.list}" var="task" varStatus="stat">
            <tr>
                <td  rowspan="2">
                    <span class="pending">${stat.count}</span>
                </td>
                <td>
                    <img style="margin-top:-8px" width="50px" height="50px" src="<%=path %>/web/userinfo/img/taskImages/${task.pic}">
                </td>
                <td class="manage-jobs-title"><a
                        href="<%=path%>/web/task/details?id=${task.id}"
                        target="_parent">${task.title}</a>
                </td>


                    <td class="manage-jobs-title mark">
                            ${task.mark.title}
                    </td>

                <td class="table-date">
                    <fmt:formatDate value="${task.acceptTime}" pattern="yyyy-MM-dd"/>
                </td>
                <td>
                    <a href="javascript:void(0)" class="delete" data-id="${task.id}"><img src="<%=path %>/web/userinfo/img/member_center/delete.jpg" width="20px" height="20px"/></a>
                </td>
            </tr>
            <tr class="wm-course-count">
                <td colspan="6">
                    <div>
                        <span>浏览：${task.browse}</span> <span>评论：${task.comments}</span>

                    </div>
                </td>
            </tr>
        </c:forEach>



        </tbody>
    </table>
    <!-- 分页 -->
    <div class="pagination-box-row" style="bottom:0px;position:absolute;width:830px">

        <p>
        <div class="meneame">
                <%--            <c:if test="${requestScope.pageInfo.pageNum eq 1}" var="result">--%>
                <%--                <span class="disabled"> < </span>--%>
                <%--            </c:if>--%>
                <%--            <c:if test="${not result}">--%>
                <%--                <a href="" data-id="${requestScope.pageInfo.pageNum}> < </a>--%>
                <%--            </c:if>--%>

            <c:forEach begin="1" end="${requestScope.pageInfo.pages}" var="i">
                <c:if test="${requestScope.pageInfo.pageNum eq i}" var="isCur">
                    <a class="current" data-id="${i}">${i}</a>
                </c:if>
                <c:if test="${not isCur}">
                    <a href="#" data-id="${i}">${i}</a>
                </c:if>
            </c:forEach>
                <%--             <a href="#?page=2"> > </a>--%>
        </div>
        </p>

    </div>
</c:if>
</body>
</html>

